package com.liran.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.liran.mapper.SysUserMapper;
import com.liran.mpPojo.SysUser;
import com.liran.service.SysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author: whh
 * @Date: 2022/7/10
 * @Description:
 */
@Service
public class SysUserServiceImpl implements SysUserService {
    @Autowired
    private SysUserMapper sysUserMapper;

    @Override
    public Boolean confirm(SysUser sysUser) {
        QueryWrapper<SysUser> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("username", sysUser.getUsername());
        queryWrapper.eq("password", sysUser.getPassword());
        SysUser user = sysUserMapper.selectOne(queryWrapper);
        if (user != null) {
            return true;
        }
        return false;
    }
}
